import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueAxiosPlugin from 'vue-axios-plugin'
import VantUI from './vantUI';
import {Toast} from 'vant'

Vue.use(Toast)
import 'lib-flexible/flexible'

Vue.use(VantUI)
Vue.use(VueAxiosPlugin, {
  // 请求拦截处理
  reqHandleFunc: config => {
    Toast.loading({
      message: "加载中...",
      forbidClick: true,
      duration:0,
    });
    return config
  },
  reqErrorFunc: error => {
    Toast.clear();
    return Promise.reject(error)
  },
  // 响应拦截处理
  resHandleFunc: response => {
    Toast.clear();
    return response
  },
  resErrorFunc: error => {
    Toast.clear();
    return Promise.reject(error)
  }
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
